<template>
  <div class="toubu">
    <div class="toubuson">
      <p class="ctp"><a href="">{{ '首页/' }}</a></p><span class="ctspan">{{ pwd }}</span>
    </div>
    <el-button @click="dialogFormVisible = true" color="#52d996" style="color: white;" v-if="Complaint">
      去投诉
    </el-button>
  </div>
  <div class="zhongjian">
    <el-dialog class="cteldialog" v-model="dialogFormVisible" title="创建投诉" modal="false" width="600">
      <el-form :model="form">
        <el-form-item label="投诉标题" :label-width="formLabelWidth">
          <el-input v-model="form.title" autocomplete="off" placeholder="请输入投诉标题" />
        </el-form-item>
        <el-form-item label="投诉内容" :label-width="formLabelWidth">
          <el-input v-model="form.content" style="height: 100px;" autocomplete="off" placeholder="请输入投诉内容" />
        </el-form-item>
        <el-form-item label="联系人" :label-width="formLabelWidth">
          <el-input v-model="form.person" autocomplete="off" placeholder="请输入联系人" />
        </el-form-item>
        <el-form-item label="练习电话" :label-width="formLabelWidth">
          <el-input v-model="form.phone" autocomplete="off" placeholder="请输入联系电话" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="dialogFormVisible = false" color="#fafafa" dark="true">取消</el-button>
          <el-button type="primary" @click="dialogFormVisibleS" dark="true" color="#52d996" style="color: white;">
            保存
          </el-button>
        </div>
      </template>
    </el-dialog>
    <el-row class="c" v-if="Complaint">
      <el-col class="ctc ctcc" :span="2">{{ title[0] }}</el-col>
      <el-col class="ctc ctcc" :span="14">{{ title[1] }}</el-col>
      <el-col class="ctc ctcc" :span="3">{{ title[2] }}</el-col>
      <el-col class="ctc ctcc" :span="3">{{ title[3] }}</el-col>
      <el-col class="ctc ctcc" :span="2">{{ title[4] }}</el-col>
    </el-row>
    <el-row class="c" v-if="!Complaint">
      <el-col class="ctc ctcc" :span="3">{{ title[0] }}</el-col>
      <el-col class="ctc ctcc" :span="15">{{ title[1] }}</el-col>
      <el-col class="ctc ctcc" :span="6">{{ title[2] }}</el-col>
    </el-row>
    <el-row class="ct" v-for="i in 14" v-if="Complaint">
      <el-col class="ctc" @click="semit" :span="2"><img src="../img/平台动态/u19.png" alt="" class="cti"></el-col>
      <el-col class="ctc" @click="semit" :span="14">{{ content[i] }}</el-col>
      <el-col class="ctc" @click="semit" :span="3">{{ time }}</el-col>
      <el-col class="ctc" @click="semit" :span="3" style='color:rgb(214, 214, 0)' v-if="i<7">{{ zhuangtai[i] }}</el-col>
      <el-col class="ctc" @click="semit" :span="3" v-if="i>=7">{{ zhuangtai[i] }}</el-col>
      <el-col class="ctc" @click="semit" :span="2" style="color: #13b69f;">{{ caozuo[i] }}</el-col>
    </el-row>
    <el-row class="ct" v-for="i in content" v-if="!Complaint">
      <el-col @click="semit" class="ctc" :span="3"><img src="../img/平台动态/u19.png" alt="" class="cti"></el-col>
      <el-col @click="semit" class="ctc ctci" :span="15">{{ i }}</el-col>
      <el-col @click="semit" class="ctc ctct" :span="6">{{ time }}</el-col>
    </el-row>
  </div>
</template>
<script setup>
import { computed, ref, reactive, defineEmits } from 'vue';

const props = defineProps({
  Platform: Object,
  page: Boolean
});
const pagepage = ref(props.page);
const emit = defineEmits(['cclick', 'ccclick']);
const semit = function () {
  pagepage.value = !pagepage.value;
  emit('cclick', pagepage.value);
};
// 是否是违规投诉页面
const Complaint = computed(() => {
  if ('flag' in props.Platform) {
    return true;
  }
});
// 
const title = computed(() => props.Platform.titleContent.title);
const content = computed(() => props.Platform.titleContent.content);
const time = computed(() => props.Platform.titleContent.time);
const zhuangtai = computed(() => props.Platform.titleContent.zhuangtai);
const caozuo = computed(() => props.Platform.titleContent.caozuo);
// 路径
const pwd = computed(() => props.Platform.pwd);

//显示form
const dialogFormVisible = ref(false);
const formLabelWidth = '140px';

const form = reactive({
  title: '',
  content: '',
  person: '',
  phone: ''
});
const dialogFormVisibleS = function () {
  dialogFormVisible.value = false;
};

const list = document.querySelectorAll('.ctc');
list.forEach((e) => {
  if (e.innerHTML == '正在处理中') {
  }
});
</script>

<style>
.cteldialog{
  width: 600px;
  height: 1000px;
}
.zhongjian {
  background-color: #fff;
  padding: 40px 30px;
}

.toubuson {
  display: flex;
  align-items: center
}

.toubu {
  display: flex;
  justify-content: space-between;
  align-items: center
}

.el-form-item::before {
  color: red;
  margin-top: 5px;
  content: '*';
}

.el-form-item__label {
  justify-content: left;
}

.el-form-item__content {
  margin-left: -70px;
}

.el-overlay-dialog {
  height: 550px;
  overflow: hidden;
}

.el-overlay {
  position: absolute;
  left: -500px;
  top: -50px;
  min-width: 150vw;
  min-height: 100vh;
}

.ctp {
  color: #999999;
  margin: 25px 0;
}

.cti {
  width: 20px;
}

.c {
  margin-bottom: -10px;
  color: #333333;
}

.ct {
  margin-bottom: -15px;
}

.ctc {
  padding-left: 10px;
  height: 20px;
  border-bottom: 1px solid #dddddd;
}

.ctc:hover {
  cursor: pointer;
}

.ctcc {
  background-color: #f6fdfd;
}

.ctct {
  color: #b3b3b3;
}

.ctci {
  color: #333333
}
</style>